package com.wgu.crawl2.service.impl;

import com.wgu.crawl2.repo.XBQGChapterRepository;
import com.wgu.crawl2.service.XBQGChapterService;
import com.wgu.xbqg.XBQGChapter;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.transaction.Transactional;
import java.util.List;

/**
 * @Author: w
 * @Date: 2019/6/28 10:11
 * @Version 1.0
 */
@Service
public class XBQGChapterServiceImpl implements XBQGChapterService {
    @Resource
    private XBQGChapterRepository xbqgChapterRepository;

    @Override
    @Transactional
    public XBQGChapter save(XBQGChapter chapter) {
        return xbqgChapterRepository.save(chapter);
    }

    @Override
    public List<XBQGChapter> list(Long bookId) {
        return xbqgChapterRepository.findByBookId(bookId);
    }
}
